import {Storage} from 'src/utils/storage.js'

export async function getCode() {
  // 1.授权请求
  // 2.获取code
  // Storage.set('payScan', window.location.search, true);
  // let code = Tools.getQueryValue("code")
  // if (!code) {
    if (process.env.NODE_ENV === 'production') {
      location.href = 'http://open.weixin.qq.com/connect/oauth2/authorize?appid=' + process.env.APPID + '&redirect_uri=' + encodeURIComponent(process.env.DOMAIN_NAME) + '&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
    } else {
      location.href = process.env.DOMAIN_NAME + '/?code=123'
    }
  // }
}
